package com.yuncheng.common.base.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yuncheng.i18n.ExcelI18n;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

public class CcBaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键，系统自动赋值")
	protected String id;

	@ApiModelProperty(value = "创建人，系统自动赋值")
	@Excel(name = "创建人", width = 15)
	@ExcelI18n(name = "export.common.entity.createBy")
	protected String createBy;

	@ApiModelProperty(value = "创建时间，系统自动赋值")
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@ExcelI18n(name = "export.common.entity.createTime")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	protected Date createTime;

	@ApiModelProperty(value = "更新人，系统自动赋值")
	@Excel(name = "更新人", width = 15)
	@ExcelI18n(name = "export.common.entity.updateBy")
	protected String updateBy;

	@ApiModelProperty(value = "更新时间，系统自动赋值")
	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@ExcelI18n(name = "export.common.entity.updateTime")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	protected Date updateTime;

	@Excel(name="部门编码",width=25)
	@ExcelI18n(name = "export.common.entity.sysOrgCode")
	@ApiModelProperty(value = "部门编码，系统自动赋值")
	protected String sysOrgCode;

	/*@Excel(name="创建部门编码",width=25)
	@ExcelI18n(name = "export.common.entity.createOrgCode")
	@ApiModelProperty(value = "创建部门编码，系统自动赋值")
	protected String createOrgCode;*/

	/*@Excel(name="修改部门编码",width=25)
	@ExcelI18n(name = "export.common.entity.updateOrgCode")
	@ApiModelProperty(value = "修改部门编码，系统自动赋值")
	protected String updateOrgCode;*/

	/*@Excel(name="创建人ip",width=25)
	@ExcelI18n(name = "export.common.entity.createByIp")
	@ApiModelProperty(value = "创建人ip，系统自动赋值")
	protected String createByIp;

	@Excel(name="修改人ip",width=25)
	@ExcelI18n(name = "export.common.entity.updateById")
	@ApiModelProperty(value = "修改人ip，系统自动赋值")
	protected String updateByIp;*/

	/*@Excel(name="修改人ip",width=25)
	@ExcelI18n(name = "export.common.entity.updateById")
	@ApiModelProperty(value = "删除标记，系统自动赋值")
	@TableLogic
	protected String delFlag;*/

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getSysOrgCode() {
		return sysOrgCode;
	}

	public void setSysOrgCode(String sysOrgCode) {
		this.sysOrgCode = sysOrgCode;
	}

	@Override
	public String toString() {
		return "CcBaseEntity{" +
				"id='" + id + '\'' +
				", createBy='" + createBy + '\'' +
				", createTime=" + createTime +
				", updateBy='" + updateBy + '\'' +
				", updateTime=" + updateTime +
				", sysOrgCode='" + sysOrgCode + '\'' +
				'}';
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		CcBaseEntity model = (CcBaseEntity) o;
		return Objects.equals(id, model.id);
	}

	@Override
	public int hashCode() {
		return Objects.hash(id);
	}
}
